<template>
    <view class="btn-get-code">
        <text class="btn" :class="sendAble ? 'btn-success-hollow' : 'btn-fail-hollow'" @click="getCode">{{
            sendText
        }}</text>
    </view>
</template>

<script>
export default {
    props: {
        codeType: {
            type: Number,
            default: 0,
        },
        sendAble: {
            type: Boolean,
            default: true,
        },
        sendText: {
            type: String,
            default: "获取验证码",
        },
    },
    data() {
        return {}
    },
    methods: {
        //获取验码
        getCode() {
            if (!this.sendAble) {
                return
            }
            this.$emit("getSMSCode")
        },
    },
}
</script>

<style lang="scss">
.btn {
    margin-left: 0;
}
.btn-fail-hollow {
    color: #999;
    border: solid 1rpx #999;
}
</style>
